package com.dongdong.android.demo.ui.login;

import com.dongdong.android.framework.http.ApiManager;
import com.dongdong.android.framework.http.requestentity.reqUserEntity;
import com.dongdong.android.framework.http.resultentity.BaseRsultEntity;
import com.dongdong.android.framework.http.resultentity.UserInfoEntity;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * @author dongdong
 * @date 2018/3/29
 */

public class LoginModel implements LoginContract.Model {
    @Override
    public Observable<BaseRsultEntity<UserInfoEntity>> login(reqUserEntity entity) {
        return ApiManager.getInstance().userService.login(entity).subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }
}
